feat: Add @auto_pipeline Decorator for Advanced Multi-Level Pipelining#327
Open
zacliu2023 wants to merge 2 commits intomainfrom
Open
feat: Add @auto_pipeline Decorator for Advanced Multi-Level Pipelining#327zacliu2023 wants to merge 2 commits intomainfrom
zacliu2023 wants to merge 2 commits intomainfrom
Conversation
Introduces automatic multi-level pipelining optimization for Triton kernels
with up to 2.19x speedup on GEMM operations.
## Features
- Global-to-Shared (G2S) Pipelining: Multi-stage async data prefetching
- Shared-to-Register (S2R) Pipelining: Double-buffering optimization
- Warp Specialization: Producer-consumer pattern with dedicated warps
## Performance (2048x2048x2048 GEMM on A100)
| Kernel | TFLOPS | Speedup |
|--------|--------|---------|
| No Pipeline | 86.03 | 1.00x |
| Default Pipeline | 141.17 | 1.64x |
| AutoPipeline | 188.02 | 2.19x |
## Usage
```python
from triton.language import auto_pipeline, PipelineConfig
@triton.jit
@auto_pipeline(PipelineConfig(
global_to_shared_stages=4,
shared_to_register_stages=2,
enable_async_copy=True,
))
def matmul_kernel(...):
...
```
TLX language extensions are optional and not needed for core auto_pipeline functionality. Remove TLX to simplify the PR: - Remove third_party/tlx/language/tlx directory - Remove TLX symlink from python/triton/language/extra - Remove TLX imports from code_generator.py - Remove create_tlx_autotune_configs from public exports The core @auto_pipeline decorator still works with: - G2S pipelining (global_to_shared_stages) - S2R pipelining (shared_to_register_stages) - Basic warp specialization config (WarpSpecConfig)
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the @auto_pipeline decorator that enables automatic multi-level pipelining optimization for Triton kernels, achieving up to 2.18x speedup on GEMM operations compared to non-pipelined kernels.
Performance Results (2048x2048x2048 GEMM on Nvidia)
AutoPipeline vs Default Pipeline: 1.53x faster
Features
Usage
Files Changed
How It Works
- Circular buffer allocation for multi-stage pipelining
- Double-buffering for S2R optimization
- Async copy instruction insertion
- Synchronization barrier placement
Test Plan
Breaking Changes
None. This is a purely additive feature that doesn't modify existing APIs.
Dependencies